using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using YABlog.DAL;

namespace YABlog.BLL
{
    public class CommentsAction
    {
        CommentsDb comDb = new CommentsDb();

        public CommentsAction()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public int GetCommentsByEntry(int id, Repeater rep)
        {
            DataTable table = comDb.GetCommentsByEntry(id);
            int count = table.Rows.Count;

            rep.DataSource = comDb.GetCommentsByEntry(id);
            rep.DataBind();
            return count;
        }

        public bool AddComment(int bid, string name, string comment)
        {
            return comDb.AddComment(bid, name, comment);
        }
    }
}
